<!DOCTYPE html>
<html>
<head>
	<!-- 设置浏览器不缓存 -->
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="0">
	<!-- Content-Type -->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<!-- Favicon -->
	<link rel="shortcut icon" href="./images/logo.png">
	<title>企业服务共享中心-供应商管理</title>
	<!--stylesheets-->
	<link rel="stylesheet" href="./plugins/element/index.css">
	<script src="./plugins/vue/vue.js"></script>
	<script src="./plugins/element/index.js"></script>
	<script src="./plugins/axios/axios.min.js"></script>
	<script src="./js/common/public.js?v=0.8.0.3"></script>
	<!-- 自定义样式表 -->
	<link rel="stylesheet" href="./css/base.css?v=0.8.0.3">
</head>
<body>
<div id="app">
<template>
<el-container class="maincontainer">
	<el-container class="submaincontainer">
		<el-card class="box-card" style="position:relative;width:330px" shadow="never" v-show="leftbar_show">
		  <div style="position:absolute;left:0;top:0;right:0;bottom:0;overflow-y:auto;overflow-x:hidden;padding-left: 20px;padding-top: 20px;padding-right: 20px;">
			<el-form :model="queryForm" ref="queryForm" >
					<el-form-item label="关键字" prop="keyword"  maxlength="20" autocomplete="off">
					  <el-input v-model="queryForm.keyword"></el-input>
					</el-form-item>
					<el-form-item label="服务项目" prop="serviceid">
						<el-select v-model="queryForm.serviceid" multiple placeholder="请选择" filterable>
						  <el-option
							v-for="item in services"
							:key="item.id"
							:label="item.name"
							:value="item.id">
						  </el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="状态" prop="status">
						<el-select v-model="queryForm.status" multiple placeholder="请选择" filterable>
						  <el-option
							v-for="item in ['正常','已废弃']"
							:key="item"
							:label="item"
							:value="item">
						  </el-option>
						</el-select>
					</el-form-item>
					<el-button size="small" type="primary" @click.native.prevent="start" style="position:fixed;left:20px;bottom:5px;">查询</el-button>
				  </el-form-item>
			</el-form>
		  </div>
		</el-card>
		<el-card class="box-card" style="width:100%" shadow="never">
		  <div slot="header" class="clearfix">
		  <i v-on:click="showLeftBar()" v-bind:class="[leftbar_show ? 'el-icon-s-fold' : 'el-icon-s-unfold']" style="color:#409EFF;cursor:pointer;"></i>
			<span>供应商列表</span>
			<el-button-group style="float: right;margin-top:0px;">
					<el-tooltip v-for="item in toolbar" class="item" effect="dark" v-bind:content="item.content" placement="top-start">
						  <el-button size="small" v-bind:icon="item.icon" v-bind:type="item.type" @click="toolAction(item.content)">{{item.content}}</el-button>
					</el-tooltip>
			</el-button-group>
		  </div>
		  <div>
			  <el-table
			row-key="id"
			  border
				ref="multipleTable"
				@select='selectionChange'
				:data="pagedata"
				tooltip-effect="dark"
				:height="tableHeight"
				style="width: 100%;"
				@selection-change="handleSelectionChange">
				<el-table-column type="expand" prop="detail">
				  <template slot-scope="scope">
					 <el-table :data="scope.row.detail" stripe border>
						 <el-table-column label="#" type="index"></el-table-column>
						 <el-table-column label="服务项目" prop="service"></el-table-column>
						 <el-table-column label="规格说明" prop="specs"></el-table-column>
						 <el-table-column label="成本价" prop="cost"></el-table-column>
						 <el-table-column label="单价" prop="price"></el-table-column>
						 <el-table-column label="服务区域" prop="area"></el-table-column>
						 <el-table-column label="准入行业" prop="industry"></el-table-column>
						 <el-table-column label="备注" prop="memo"></el-table-column>
						 <el-table-column label="操作" min-width="50">
							  <template slot-scope="scope">
								  <el-tooltip class="item" effect="dark" content="编辑服务项目" placement="top-start">
									<el-link type="primary" icon="el-icon-edit" @click="editDetail(scope.$index, scope.row)"></el-link>
								  </el-tooltip>
								 <!-- <el-tooltip class="item" effect="dark" content="删除服务项目" placement="top-start">
									<el-link type="danger" icon="el-icon-delete" @click="delDetail(scope.$index, scope.row)"></el-link>
								  </el-tooltip -->
							  </template>
						</el-table-column>
					 </el-table>
				  </template>
				</el-table-column>
				<!-- <el-table-column
				  type="selection"
				  min-width="55">
				</el-table-column> -->
				<el-table-column
				v-for="column in tablecolums"
				  v-bind:prop="column.prop"
				  v-bind:label="column.label"
				  v-bind:min-width="column.width"
				  show-overflow-tooltip>
				</el-table-column>
				<el-table-column label="操作" min-width="100">
				  <template slot-scope="scope">
					  <el-link type="primary" @click="addDetail(scope.$index, scope.row)">添加服务</el-link>
					  <el-link type="primary" @click="edit(scope.$index, scope.row)">编辑</el-link>
					  <!-- <el-link type="danger" @click="del(scope.$index, scope.row)">删除</el-link> -->
				  </template>
				</el-table-column>
			  </el-table>
			  <div style="margin-top: 20px">
				<el-pagination
				@current-change="handleCurrentPageChange"
				:current-page="queryForm.pageNo"
				:page-sizes="queryForm.pagesizes"
				  :page-size="queryForm.pagesize"
				  background
				  layout="total,sizes, prev, pager, next"
				  :total="pagetotal">
				</el-pagination>
			  </div>			  
		  </div>
		</el-card>
	</el-container>
</el-container>
<el-dialog :close-on-click-modal="false"  title="供应商信息" :visible.sync="supplierFormVisible" width="600px">
    <el-form :model="supplierForm" :rules="supplierRules" ref="supplierForm" label-width="80px">
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="供应商" prop="name"  >
				  <el-input v-model="supplierForm.name" maxlength="30"></el-input>
			  </el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="城市" prop="city"  >
				  <el-input v-model="supplierForm.city" maxlength="20"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="联系人" prop="contacter"  >
				  <el-input v-model="supplierForm.contacter" maxlength="10"></el-input>
			  </el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="联系电话" prop="tel"  >
				  <el-input v-model="supplierForm.tel" maxlength="20"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			<el-radio-group v-model="supplierForm.poclear">
				<el-form-item label="结算方式" prop="poclear">
				  <el-radio label="次结">次结</el-radio>
				  <el-radio label="月结">月结</el-radio>
				</el-form-item>
			</el-radio-group>
		  </el-col>
		  <el-col :span="12">
			<el-radio-group v-model="supplierForm.paytype">
				<el-form-item label="付款方式" prop="paytype">
				  <el-radio label="对私">对私</el-radio>
				  <el-radio label="对公">对公</el-radio>
				</el-form-item>
			</el-radio-group>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			<el-radio-group v-model="supplierForm.isinvoice">
				<el-form-item label="开票" prop="isinvoice">
				  <el-radio label="是">是</el-radio>
				  <el-radio label="否">否</el-radio>
				</el-form-item>
			</el-radio-group>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="状态" prop="status">
				<el-select v-model="supplierForm.status" placeholder="请选择">
				  <el-option
					v-for="item in ['正常','已废弃']"
					:key="item"
					:label="item"
					:value="item">
				  </el-option>
				</el-select>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="24">
			  <el-form-item label="备注" prop="remark">
				  <el-input v-model="supplierForm.remark" maxlength="250"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
    </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="supplierFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="cofirm">确 定</el-button>
  </div>
</el-dialog>
<el-dialog :close-on-click-modal="false"  title="服务信息" :visible.sync="supplierDetailFormVisible" width="600px">
    <el-form :model="supplierDetailForm" :rules="supplierDetailRules" ref="supplierDetailForm" label-width="80px">
		<el-row :gutter="20">
		  <el-col :span="12">
			<el-form-item label="服务项目" prop="serviceid">
				<el-select v-model="supplierDetailForm.serviceid" filterable >
					  <el-option
						v-for="item in services"
						:key="item.id"
						:label="item.name"
						:value="item.id">
					  </el-option>
				</el-select>
			</el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="规格说明" prop="specs"  >
				  <el-input v-model="supplierDetailForm.specs" maxlength="200"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="成本" prop="cost"  >
				  <el-input v-model="supplierDetailForm.cost" maxlength="10"></el-input>
			  </el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="价格" prop="price"  >
				  <el-input v-model="supplierDetailForm.price" maxlength="10"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="区域" prop="area">
				  <el-input v-model="supplierDetailForm.area" maxlength="20"></el-input>
			  </el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="准入行业" prop="industry">
				  <el-input v-model="supplierDetailForm.industry" maxlength="100"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="24">
			  <el-form-item label="备注" prop="memo">
				  <el-input v-model="supplierDetailForm.memo" maxlength="250"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
    </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="supplierDetailFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="cofirmDetail">确 定</el-button>
  </div>
</el-dialog>
</template>
</div>
</body>
<script src="./js/supplier.js?v=0.8.0.3"></script>
</html>
